Skip to content

Respect REST endpoint capabilities when checking view existence - #3960

Open
kevinjqliu wants to merge 6 commits into
apache:mainfrom
kevinjqliu:kevinjqliu-view-exists-endpoint-fallback
Open

kevinjqliu wants to merge 6 commits into
apache:mainfrom
kevinjqliu:kevinjqliu-view-exists-endpoint-fallback

Conversation

@kevinjqliu

@kevinjqliu kevinjqliu commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Rationale for this change

Make RestCatalog.view_exists() fall back to load_view() when the server does not advertise the view HEAD endpoint, following the existing RestCatalog.table_exists() fallback and namespace existence checks. Preserve advertised HEAD behavior and existing capability defaults.

Are these changes tested?

Added separate regressions for advertised GET support, legacy servers with view support enabled, and missing views. The focused REST/view suite passes: 44 tests. Ruff, mypy, and applicable commit hooks pass.

Are there any user-facing changes?

view_exists() works with GET-capable servers that do not advertise HEAD. Missing views return False; other load errors propagate.

kevinjqliu and others added 5 commits September 13, 2026 16:34
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@kevinjqliu
kevinjqliu requested review from Fokko and geruh and a lite review from Copilot September 13, 2026 23:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No unresolved issues were identified, and the focused test suite passes.

Pull request overview

Updates RestCatalog.view_exists() to use GET fallback when the REST server does not support the view HEAD endpoint.

Changes:

  • Added capability-aware view existence checks.
  • Added regression tests for advertised, legacy, and missing-view scenarios.
File summaries
File Description
tests/catalog/test_rest.py Adds fallback behavior regression tests.
pyiceberg/catalog/rest/__init__.py Implements capability-aware view existence checks.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@rambleraptor rambleraptor left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double checked on Java and this is how it's handled there too. Thanks for doing this!

Comment thread pyiceberg/catalog/rest/__init__.py
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants